/*
 * process.h
 *
 *  Created on: May 14, 2013
 *      Author: Edward
 */
#ifndef PROCESS_H_
#define PROCESS_H_

#define COMPUTE     		  0
#define IO                    1
#define KEYBOARD              2
#define IO_SERVICE            3
#define KEYBOARD_SERVICE      4
#define NETWORK_SERVICE       5


typedef struct process_str {
	int proc_type;      // code for process type, e.g. 0=compute, 1=i0, 2=keyboard, etc.
	int	no_steps;		// number of time steps before resetting to 0 - number of instructions
	int no_requests;	// number of requests that will be generated during the process run
	int * requests;		// an array of requests, each request (e.g. io service) is issued at a specific
						// time step. These are the synchronous events that result in traps being issued.
						// You can get fancy and make this an array of RequestTypeStr which contains the
						// step number when issued, and a request type (e.g. 0=io, 1=sync, etc.)
   //member functions
   int(*setProcType)(struct process_str *, int);
   int(*getProcType)(struct process_str *);
   int(*setNoSteps)(struct process_str *);
   int(*getNoSteps)(struct process_str *);
   int(*setNoRequests)(struct process_str *);
   int(*getNoRequests)(struct process_str *);
   int(*setRequests)(struct process_str *, int);
   int*(*getRequests)(struct process_str *);
   int(*toStringProc)(struct process_str *);



} ProcessStr;

typedef ProcessStr * ProcessPtr;

ProcessPtr newProcessConstructor();

int setProcType(ProcessPtr  this, int type);
int getProcType(ProcessPtr  this);
int setNoSteps(ProcessPtr  this);
int getNoSteps(ProcessPtr  this);
int setNoRequests(ProcessPtr  this);
int getNoRequests(ProcessPtr  this);
int setRequests(ProcessPtr  this, int request);
int* getRequests(ProcessPtr  this);
int toStringProc(ProcessPtr  this);


#endif /* PROCESS_H_ */
